package com.ali.g308_ai.pojo.vo;


import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.ai.chat.messages.Message;

@Data
@NoArgsConstructor
public class ChatHistoryVO {
    private String role;

    private String content;

    public ChatHistoryVO(Message message) {
        switch (message.getMessageType()){
            case USER -> this.role = "user";
            case  ASSISTANT-> this.role = "assistant";
            default -> this.role = "unknown";
        }
        this.content = message.getText();
    }
}
